<?php  $num = 1;
if (count($results) > 0) {
    foreach ($results as $key => $item) {
        if (count($item['sub']) == 0) continue; ?>
        <div class="box_20" style="position: absolute; display: block; z-index:<?php echo $key ?>">
            <?php foreach ($item['sub'] as $k => $i) {
                ?>
                <?php if ($num == 1 || $k == 0) { ?>
                    <ul>
                <?php
                }
                $num++; ?>
                <li>
                    <a href="<?php echo $i['url'] ?>"><?php echo $i['name'] ?></a>
                </li>
                <?php if ($k == count($item['sub']) - 1 || $num == 6) {
                    $num = 1; ?>
                    </ul><?php } ?>

            <?php } ?>
        </div>

    <?php
    }
}


